import { Component, OnInit, Input } from '@angular/core';

@Component({
  selector: 'twitte-like',
  templateUrl: './like.component.html',
  styleUrls: ['./like.component.css']
})
export class LikeComponent {
  @Input("isLike") isLike: boolean;
  @Input("likesCount") likesCount: number;

  onLikeChanged() {
    this.likesCount += (this.isLike) ? -1 : 1;
    this.isLike = !this.isLike;
  }
}
